<?php header("Content-Type: text/html; charset=UTF-8");?>
<html>
<head>
<title>리스트</title>
</head>

<body>
<?php //var_dump($result)?>
	<table border="1">
		<tr>
			<th>제품이름</th>
			<th>최소가격</th>
			<th>최대가격</th>
			<th>제조일자</th>
			<th>쇼핑카운트</th>
			<th>옵션</th>
			<th>만든코드</th>
			<th>제조사</th>
			<th>브랜드이름</th>
	
			<th>이미지</th>
		</tr>
		<?php foreach ($result as $a):?>
		<tr>
			<td><?php echo anchor('categorylist/product/'.$a['code'].'/'.$offset, $a['name']);?></td>
			<td><?=$a['minPrice']?></td>
			<td><?=$a['avgPrice']?></td>
			<td><?=$a['madeDate']?></td>
			<td><?=$a['shopCount']?></td>
			<td><?=$a['option']?></td>
			<td><?=$a['makeCode']?></td>
			<td><?=$a['makeName']?></td>
			<td><?=$a['brandName']?></td>
			
			<td><?=$a['image']?></td>
		</tr>
		<?php endforeach;?>
	</table>
	
	<center>
	<?php 
		$count=(int)($offset/10);
		if($count<6){
			$count=5;
			$end=$count+10;
		}
		$end=$count+5;
		$start=$count-5;
		$view=$end*100;
		echo anchor('categorylist/clist/'.$a['cate1']."/".$a['cate2'].'/0', '<');
		for($start ; $start<$end; $start++){
			echo " ";
			echo anchor('categorylist/clist/'.$a['cate1']."/".$a['cate2']."/".($start*10), $start+1);
		}
		echo anchor('categorylist/clist/'.$a['cate1']."/".$a['cate2'].'/'.($view/10), '>');
		?>
	</center>
		
</body>
</html>